package com.cloud.shopping.cart.feign;

import com.cloud.shopping.cart.model.Cart;
import com.cloud.shopping.tool.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author John.zhang
 * @version Id: CartFeign, v 1.0 2021/1/3 19:29 ZhiYong Exp $
 */
@FeignClient(value = "shopping-cart")
public interface CartFeign {

    /**
     * 指定ID集合的购物车数据
     *
     * @param ids ids
     * @return RespResult
     */
    @PostMapping(value = "/cart/list")
    RespResult<List<Cart>> list(@RequestBody List<String> ids);

    /**
     * 删除购物车数据
     *
     * @param ids ids
     * @return RespResult
     */
    @DeleteMapping(value = "/cart")
    RespResult delete(@RequestBody List<String> ids);

}
